<template>
  <a-config-provider :locale="locale">
    <div id="app">
      <router-view/>
    </div>
  </a-config-provider>
</template>
<script>
  import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
  import enquireScreen from '@/utils/device'

  export default {
    data () {
      return {
        locale: zhCN,
      }
    },
    created () {
      let that = this
      enquireScreen(deviceType => {
        // tablet
        if (deviceType === 0) {
          that.$store.commit('TOGGLE_DEVICE', 'mobile')
          that.$store.dispatch('setSidebar', false)
        }
        // mobile
        else if (deviceType === 1) {
          that.$store.commit('TOGGLE_DEVICE', 'mobile')
          that.$store.dispatch('setSidebar', false)
        }
        else {
          that.$store.commit('TOGGLE_DEVICE', 'desktop')
          that.$store.dispatch('setSidebar', true)
        }

      })
    },
    mounted() {
      let that = this
      window.onresize = () => {
        return (() => {
          that.$store.commit('PAGE_HEIGHT', document.body.clientHeight)
        })()
      }
    },
  }
</script>
<style>
 @import "assets/less/index.less";
  #app {
    height: 100%;
  }
  .table-hint .ant-empty-normal{
    margin:0;
  }
  body{
    background-color: #F1F4F5 !important;
  }
  body::-webkit-scrollbar {display: none;}

</style>